package com.woniuxy.oa.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;


@Configuration
public class UploadConfig extends WebMvcConfigurationSupport{
	
	@Override
	protected void addResourceHandlers(ResourceHandlerRegistry registry) {
		// 防止拦截静态资源
		registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
		// 配置映射,为文件上传后磁盘存储位置与浏览器访问资源路径的映射
		registry.addResourceHandler("/file/**").addResourceLocations("file:D:/oa_office/resources/file/");
		registry.addResourceHandler("/icon/**").addResourceLocations("file:D:/oa_office/resources/icon/");
	}
}





